<?php

namespace app\command;

use schedule\console\Command;
use think\console\Input;
use think\console\Output;

class QueueTask extends Command
{
    protected function configure()
    {
        $this->setName('queue')->setDescription('队列监听定时任务');
    }

    protected function execute(Input $input, Output $output)
    {
        if (function_exists('shell_exec') && is_callable('shell_exec')) {
            $file = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'queue_monitor.sh';
            shell_exec($file);
        }
    }
}
